###### User-defind system parameters start ######

PREFIX          = /d/Code/GitHub/VEDO.dev/
XERCESC_ROOT    = /c/usr/xercesc/GCC/
COMPILER_MODE  := mingw
MAKE            = /bin/make

#PREFIX         = ${HOME}/usr/local/vedo/
#XERCESC_ROOT   = ${HOME}/usr/local/xerces-c/
#COMPILER_MODE := gcc
#COMPILER_MODE := intel
#MAKE           = gmake

####### User-defind system parameters end #######



USR_INC          = /usr/include/
USR_CXX_FLAG     = -I${USR_INC}
USR_LIB          = /usr/lib/
USR_LNK_FLAG     = -L${USR_LIB}

# Xerces-C (Apache XML Parser)
XERCESC_INC      = ${XERCESC_ROOT}include/
XERCESC_CXX_FLAG = -I${XERCESC_INC}
XERCESC_LIB      = ${XERCESC_ROOT}lib/
XERCESC_LNK_FLAG = -L${XERCESC_LIB} -lxerces-c

VEDO_PREDEFINE   = _VEDO_DEBUG
VEDO_BIN         = ${PREFIX}bin/${COMPILER_MODE}/
VEDO_OBJ         = ${PREFIX}obj/${COMPILER_MODE}/
VEDO_OBJ_DEBUG   = ${PREFIX}obj/${COMPILER_MODE}/debug/
VEDO_OBJ_RELEASE = ${PREFIX}obj/${COMPILER_MODE}/release/
VEDO_SRC         = ${PREFIX}src/
VEDO_CXX_FLAG    = -I${VEDO_SRC}
VEDO_LIB         = ${PREFIX}lib/${COMPILER_MODE}/
VEDO_LNK_FLAG    = -L${VEDO_LIB} -lvedo-common -lvedo-framework -lvedo-njr
VEDO_LNK_FLAGx   = -L${VEDO_LIB} -lvedo-common -lvedo-framework-x -lvedo-njr
VEDO_LNK_FLAGd   = -L${VEDO_LIB} -lvedo-common-debug -lvedo-framework-debug -lvedo-njr-debug
VEDO_LNK_FLAGxd  = -L${VEDO_LIB} -lvedo-common-debug -lvedo-framework-x-debug -lvedo-njr-debug
IMP              = Implementation/
INC              = Interfaces/

SHARE_CXX_FLAG   = ${VEDO_CXX_FLAG} ${USR_CXX_FLAG}
SHARE_CXX_FLAGx  = ${VEDO_CXX_FLAG} ${XERCESC_CXX_FLAG} ${USR_CXX_FLAG}

SHARE_LNK_FLAG   = ${VEDO_LNK_FLAG} ${USR_LNK_FLAG}
SHARE_LNK_FLAGx  = ${VEDO_LNK_FLAGx} ${XERCESC_LNK_FLAG} ${USR_LNK_FLAG}
SHARE_LNK_FLAGd  = ${VEDO_LNK_FLAGd} ${USR_LNK_FLAG}
SHARE_LNK_FLAGxd = ${VEDO_LNK_FLAGxd} ${XERCESC_LNK_FLAG} ${USR_LNK_FLAG}

ifeq ($(COMPILER_MODE), mingw)
   MPI_ROOT      = /c/usr/mpich2/32/
   MPI_INC       = ${MPI_ROOT}include/
   MPI_CXX_FLAG  = -I${MPI_INC}
   MPI_LIB       = ${MPI_ROOT}lib/
   MPI_LNK_FLAG  = -L${MPI_LIB} -lmpi
   COMPILER_ROOT = /usr/
   COMPILER_INC  = ${COMPILER_ROOT}include/
   COMPILER_LIB  = ${COMPILER_ROOT}lib/
   CXX           = /mingw/bin/g++
   CXX_FLAG      = ${SHARE_CXX_FLAG} -I${COMPILER_INC}
   CXX_FLAGd     = -D${VEDO_PREDEFINE} -O0 ${SHARE_CXX_FLAG} -I${COMPILER_INC}
   CXX_FLAGx     = ${SHARE_CXX_FLAGx} -I${COMPILER_INC}
   CXX_FLAGxd    = -D${VEDO_PREDEFINE} -O0 ${SHARE_CXX_FLAGx} -I${COMPILER_INC}
   mCXX          = ${CXX}
   #mCXX          = ${MPI_ROOT}bin/mpicxx
   mCXX_FLAG     = ${MPI_CXX_FLAG} ${CXX_FLAG}
   mCXX_FLAGd    = -D${VEDO_PREDEFINE} -O0 ${mCXX_FLAG}
   #mCXX_FLAGg    = ${PARMETIS_INC} ${mCXX_FLAG}
   #mCXX_FLAGgd   = -D${VEDO_PREDEFINE} -O0 ${mCXX_FLAGg}
   LNK           = ${CXX}
   LNK_FLAG      = ${SHARE_LNK_FLAG} -L${COMPILER_LIB}
   LNK_FLAGx     = ${SHARE_LNK_FLAGx} -L${COMPILER_LIB}
   LNK_FLAGd     = ${SHARE_LNK_FLAGd} -L${COMPILER_LIB}
   LNK_FLAGxd    = ${SHARE_LNK_FLAGxd} -L${COMPILER_LIB}
   mLNK          = ${mCXX}
   mLNK_FLAG     = ${MPI_LNK_FLAG} ${SHARE_LNK_FLAG}
   mLNK_FLAGd    = ${MPI_LNK_FLAG} ${SHARE_LNK_FLAGd}
   #mLNK_FLAGg    = ${PARMETIS_LIB} -lparmetis -lmetis ${MPI_LIB} ${SHARE_LNK_FLAG}
   #mLNK_FLAGgd   = ${PARMETIS_LIB} -lparmetis -lmetis ${MPI_LIB} ${SHARE_LNK_FLAGd}
   #mLNK_FLAGpo   = ${MPI_LIB} ${SHARE_LNK_FLAGpo}
   AR            = /mingw/bin/ar
   AR_FLAG       = -r
   AR_FLAGx      = -r
else
ifeq ($(COMPILER_MODE), gcc)
   MPI_ROOT      = /d/mpich2/32/
   MPI_INC       = ${MPI_ROOT}include/
   MPI_CXX_FLAG  = -I${MPI_INC}
   MPI_LIB       = ${MPI_ROOT}lib/
   MPI_LNK_FLAG  = -L${MPI_LIB} -lmpi
   COMPILER_ROOT = /usr/
   COMPILER_INC  = ${COMPILER_ROOT}include/
   COMPILER_LIB  = ${COMPILER_ROOT}lib/
   CXX           = /mingw/bin/g++
   CXX_FLAG      = ${SHARE_CXX_FLAG} -I${COMPILER_INC}
   CXX_FLAGd     = -D${VEDO_PREDEFINE} -O0 ${SHARE_CXX_FLAG} -I${COMPILER_INC}
   CXX_FLAGx     = ${SHARE_CXX_FLAGx} -I${COMPILER_INC}
   CXX_FLAGxd    = -D${VEDO_PREDEFINE} -O0 ${SHARE_CXX_FLAGx} -I${COMPILER_INC}
   mCXX          = ${CXX}
   #mCXX          = ${MPI_ROOT}bin/mpicxx
   mCXX_FLAG     = ${MPI_CXX_FLAG} ${CXX_FLAG}
   mCXX_FLAGd    = -D${VEDO_PREDEFINE} -O0 ${mCXX_FLAG}
   #mCXX_FLAGg    = ${PARMETIS_INC} ${mCXX_FLAG}
   #mCXX_FLAGgd   = -D${VEDO_PREDEFINE} -O0 ${mCXX_FLAGg}
   LNK           = ${CXX}
   LNK_FLAG      = ${SHARE_LNK_FLAG} -L${COMPILER_LIB}
   LNK_FLAGx     = ${SHARE_LNK_FLAGx} -L${COMPILER_LIB}
   LNK_FLAGd     = ${SHARE_LNK_FLAGd} -L${COMPILER_LIB}
   LNK_FLAGxd    = ${SHARE_LNK_FLAGxd} -L${COMPILER_LIB}
   mLNK          = ${mCXX}
   mLNK_FLAG     = ${MPI_LNK_FLAG} ${SHARE_LNK_FLAG}
   mLNK_FLAGd    = ${MPI_LNK_FLAG} ${SHARE_LNK_FLAGd}
   #mLNK_FLAGg    = ${PARMETIS_LIB} -lparmetis -lmetis ${MPI_LIB} ${SHARE_LNK_FLAG}
   #mLNK_FLAGgd   = ${PARMETIS_LIB} -lparmetis -lmetis ${MPI_LIB} ${SHARE_LNK_FLAGd}
   #mLNK_FLAGpo   = ${MPI_LIB} ${SHARE_LNK_FLAGpo}
   AR            = /usr/bin/ar
   AR_FLAG       = -r
   AR_FLAGx      = -r
else
ifeq ($(COMPILER_MODE), intel)
   MPI_ROOT      = /opt/openmpi/1.4.3/intel/
   MPI_INC       = ${MPI_ROOT}include/
   MPI_CXX_FLAG  = -I${MPI_INC}
   MPI_LNK_FLAG  = -L${MPI_LIB} -lmpi
   COMPILER_ROOT = /opt/intel/Compiler/11.0/074/
   COMPILER_INC  = ${COMPILER_ROOT}include/
   COMPILER_LIB  = ${COMPILER_ROOT}lib/
   CXX           = ${COMPILER_ROOT}bin/intel64/icpc
   #CXX           = ${COMPILER_ROOT}bin/ia32/icpc
   CXX_FLAG      = ${SHARE_CXX_FLAG} -I${COMPILER_INC}
   CXX_FLAGd     = -D${VEDO_PREDEFINE} -O0 ${SHARE_CXX_FLAG} -I${COMPILER_INC}
   CXX_FLAGx     = ${SHARE_CXX_FLAGx} -I${COMPILER_INC}
   CXX_FLAGxd    = -D${VEDO_PREDEFINE} -O0 ${SHARE_CXX_FLAGx} -I${COMPILER_INC}
   mCXX          = ${MPI_ROOT}bin/mpicxx
   mCXX_FLAG     = ${MPI_CXX_FLAG} ${CXX_FLAG}
   mCXX_FLAGd    = -D${VEDO_PREDEFINE} -O0 ${mCXX_FLAG}
   #mCXX_FLAGg    = ${PARMETIS_INC} ${mCXX_FLAG}
   #mCXX_FLAGgd   = -D${VEDO_PREDEFINE} -O0 ${mCXX_FLAGg}
   LNK           = ${CXX}
   LNK_FLAG      = ${SHARE_LNK_FLAG} -L${COMPILER_LIB} -lstd
   LNK_FLAGx     = ${SHARE_LNK_FLAGx} -L${COMPILER_LIB} -lstd
   LNK_FLAGd     = ${SHARE_LNK_FLAGd} -L${COMPILER_LIB} -lstd
   LNK_FLAGxd    = ${SHARE_LNK_FLAGxd} -L${COMPILER_LIB} -lstd
   mLNK          = ${mCXX}
   mLNK_FLAG     = ${MPI_LNK_FLAG} ${SHARE_LNK_FLAG}
   mLNK_FLAGd    = ${MPI_LNK_FLAG} ${SHARE_LNK_FLAGd}
   #mLNK_FLAGg    = ${PARMETIS_LIB} -lparmetis -lmetis ${MPI_LIB} ${SHARE_LNK_FLAG}
   #mLNK_FLAGgd   = ${PARMETIS_LIB} -lparmetis -lmetis ${MPI_LIB} ${SHARE_LNK_FLAGd}
   #mLNK_FLAGpo   = ${MPI_LIB} ${SHARE_LNK_FLAGpo}
   AR            = /usr/bin/ar
   AR_FLAG       = -r
   AR_FLAGx      = -r
endif
endif
endif
